namespace Umdf.ComInterop
{
    using System;
    using System.Runtime.CompilerServices;
    using System.Runtime.InteropServices;

    [ComImport, Guid("D657FE45-460A-49C3-8219-766AE8032A80"), InterfaceType((short) 1), TypeLibType((short) 0x200)]
    public interface IWDFDevice : IWDFObject
    {
        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
        void DeleteWdfObject();
        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
        void AssignContext([In, MarshalAs(UnmanagedType.Interface)] IObjectCleanup pCleanupCallback, [In] IntPtr pContext);
        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
        void RetrieveContext(out IntPtr ppvContext);
        [PreserveSig, MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
        void AcquireLock();
        [PreserveSig, MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
        void ReleaseLock();
        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
        void RetrieveDevicePropertyStore([In] string pcwszServiceName, [In] _WDF_PROPERTY_STORE_RETRIEVE_FLAGS Flags, [MarshalAs(UnmanagedType.Interface)] out IWDFNamedPropertyStore ppPropStore, out _WDF_PROPERTY_STORE_DISPOSITION pDisposition);
        [PreserveSig, MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
        void GetDriver([MarshalAs(UnmanagedType.Interface)] out IWDFDriver ppWdfDriver);
        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
        void RetrieveDeviceInstanceId([Out, MarshalAs(UnmanagedType.LPWStr)] string Buffer, [In, Out] ref uint pdwSizeInChars);
        [PreserveSig, MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
        void GetDefaultIoTarget([MarshalAs(UnmanagedType.Interface)] out IWDFIoTarget ppWdfIoTarget);
        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
        void CreateWdfFile([In, MarshalAs(UnmanagedType.LPWStr)] string pcwszFileName, [MarshalAs(UnmanagedType.Interface)] out IWDFDriverCreatedFile ppFile);
        [PreserveSig, MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
        void GetDefaultIoQueue([MarshalAs(UnmanagedType.Interface)] out IWDFIoQueue ppWdfIoQueue);
        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
        void CreateIoQueue([In, MarshalAs(UnmanagedType.IUnknown)] object pCallbackInterface, [In] int bDefaultQueue, [In] _WDF_IO_QUEUE_DISPATCH_TYPE DispatchType, [In] int bPowerManaged, [In] int bAllowZeroLengthRequests, [MarshalAs(UnmanagedType.Interface)] out IWDFIoQueue ppIoQueue);
        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
        void CreateDeviceInterface([In] ref Guid pDeviceInterfaceGuid, [In, MarshalAs(UnmanagedType.LPWStr)] string pReferenceString);
        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
        void AssignDeviceInterfaceState([In] ref Guid pDeviceInterfaceGuid, [In, MarshalAs(UnmanagedType.LPWStr)] string pReferenceString, [In] int Enable);
        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
        void RetrieveDeviceName([Out, MarshalAs(UnmanagedType.LPWStr)] string pDeviceName, [In, Out] ref uint pdwDeviceNameLength);
        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
        void PostEvent([In] ref Guid EventGuid, [In] _WDF_EVENT_TYPE EventType, [In] IntPtr pbData, [In] uint cbDataSize);
        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
        void ConfigureRequestDispatching([In, MarshalAs(UnmanagedType.Interface)] IWDFIoQueue pQueue, [In] _WDF_REQUEST_TYPE RequestType, [In] int Forward);
        [PreserveSig, MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
        void SetPnpState([In] _WDF_PNP_STATE State, [In] _WDF_TRI_STATE Value);
        [PreserveSig, MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
        _WDF_TRI_STATE GetPnpState([In] _WDF_PNP_STATE State);
        [PreserveSig, MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
        void CommitPnpState();
        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
        void CreateRequest([In, MarshalAs(UnmanagedType.IUnknown)] object pCallbackInterface, [In, MarshalAs(UnmanagedType.Interface)] IWDFObject pParentObject, [MarshalAs(UnmanagedType.Interface)] out IWDFIoRequest ppRequest);
        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
        void CreateSymbolicLink([In, MarshalAs(UnmanagedType.LPWStr)] string pSymbolicLink);
    }
}

